/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.mobiubiq.directory.client.object;

/**
 *
 * @author Marnix Renne
 */
public final class ObjectType {
    private String type;
    private ObjectType(String type) {
        super();
        this.type = type;
    }
    
    
    public static final ObjectType LOCATION = new ObjectType("location");
    public static final ObjectType TAG = new ObjectType("tag");
    public static final ObjectType BARCODE = new ObjectType("barcode");
    
    public static ObjectType get(String type) {
        if(LOCATION.type.equalsIgnoreCase(type)) {
            return LOCATION;
        }
        if(TAG.type.equalsIgnoreCase(type)) {
            return TAG;
        }
        if(BARCODE.type.equalsIgnoreCase(type)) {
            return BARCODE;
        }
        throw new IllegalArgumentException("Unknown type: '" + type + "'");
    }
    
    public String toString() {
        return type;
    }
}
